package com.generator.base;


import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.generator.util.DateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;


/**
 * @author WangGuiXing
 */
@Data
@Accessors(chain = true)
@ApiModel(description = "基础字段")
public class BaseEntity<T> implements Serializable {

    protected Long id;

    @ApiModelProperty(hidden = true, value = "创建者")
    protected Long createBy;

    @ApiModelProperty(hidden = true, value = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    protected Date createTime;

    @ApiModelProperty(hidden = true, value = "更新者")
    protected Long updateBy;

    @ApiModelProperty(hidden = true, value = "更新时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    protected Date updateTime;

    @ApiModelProperty(value = "业务状态")
    protected Integer status;

    @ApiModelProperty(value = "备注信息")
    protected String remark;

    @ApiModelProperty(hidden = true, value = "删除标记")
    @JsonIgnore
    @TableLogic
    protected Integer delFlag;

}
